
import 'module_info.dart';

class LicenseInfo {
    bool active;
    String applicationType;
    String buildId;
    String buildName;
    String endDate;
    List<ModuleInfo> modules;
    String platformType;
    String projectName;
    String startDate;

    LicenseInfo({this.active, this.applicationType, this.buildId, this.buildName, this.endDate, this.modules, this.platformType, this.projectName, this.startDate});

    factory LicenseInfo.fromJson(Map<String, dynamic> json) {
        return LicenseInfo(
            active: json['active'], 
            applicationType: json['applicationType'], 
            buildId: json['buildId'], 
            buildName: json['buildName'], 
            endDate: json['endDate'], 
            modules: json['modules'] != null ? (json['modules'] as List).map((i) => ModuleInfo.fromJson(i)).toList() : null,
            platformType: json['platformType'], 
            projectName: json['projectName'], 
            startDate: json['startDate'], 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['active'] = this.active;
        data['applicationType'] = this.applicationType;
        data['buildId'] = this.buildId;
        data['buildName'] = this.buildName;
        data['endDate'] = this.endDate;
        data['platformType'] = this.platformType;
        data['projectName'] = this.projectName;
        data['startDate'] = this.startDate;
        if (this.modules != null) {
            data['modules'] = this.modules.map((v) => v.toJson()).toList();
        }
        return data;
    }
}